import java.util.Objects;

class MyArray<T>{
    public Object[] array=new Object[10];
    public  void setValue(int pos,T val){
        array[pos]=val;
    }
    public T getValue(int pos){
        return (T)array[pos];
    }
    public T[] getArray(){
        return  (T[])array;
    }
}
public class Test {
    public static void main(String[] args) {
        MyArray<Integer> myArray=new MyArray<>();
        myArray.setValue(0,1);
        myArray.setValue(1,3);
        System.out.println(myArray.getValue(1));
        MyArray<String> myArray1=new MyArray<>();
        myArray1.setValue(0,"hello");
        myArray1.setValue(0,"world");
        System.out.println(myArray1.getValue(0));
        Object[] arr= myArray.getArray();
    }
}
